<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div id="root">
		<ul id="liebiao"></ul>
	</div>
	<script type="text/javascript">
	//number,string,boolean,undefiend,null
	//数组 == object
		var lb =document.querySelector('#liebiao');
		var arr = [
		"刘德华",
		"张学友",
		"黎明",
		"郭富城",
		];
		arr[4]="陈奕迅";
		arr[5]="林俊杰";
		arr[6]="周杰伦";
		var obj = {

		}
		obj[0]="马云";
		obj[1]="孙正义";
		obj[2]="马化腾";
		obj[3]="李嘉诚";

		//obj["name"]="首富";
       obj.name="首富";
		//对象的迭代问题
		//对象和数组的对比
		for(var i=0;i<arr.length;i++){
			lb.innerHTML+=`<li><a href='#'>${arr[i]}</a></li>`;
		}
		for(var i in obj){
			lb.innerHTML+=`<li><a href='#'>${arr[i]}</a></li>`;
		}

	</script>
	
</body>
</html>